package com.yan.dao;

import com.yan.pojo.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StudentMapper {

    //查询所有学生
    List<Student> studentList();

    // 老师查看自己班的学生
    List<Student> studentByTeacher(Integer teacherId);

    // 学生查看自己的信息
    List<Student> studentByStu(Integer studentId);

    public boolean addStudent(Student student);

    public boolean addStudentByTeacher(Student student);

    @Insert("insert into student (studentId,status,password,isDelete) values (#{studentId},'A',#{password},1)")
    public boolean registerStudent(@Param("studentId") Integer studentId, @Param("password") String password);
    // 我想起来了   多个参数的要带@Param，单个参数可以不带
    public boolean updateStudent00(Student student);

    public boolean updateStudent01(Student student);

    public boolean updateStudent02(Student student);

    public boolean delStudentByStudentId(Integer studentId);

    // 修改学生密码
    public boolean updatePassword(@Param("studentId") Integer studentId, @Param("password") String newPassword);

    //@Select("select * from student where studentId = #{studentId}")
    Student getStudentById(Integer studentId);

    List<Student> findStudent(String keyWords);

    // 添加学生到老师
    public boolean addStuToTeacher(@Param("studentId")Integer studentId, @Param("teacherId")Integer teacherId);

    //查询老师是否已经添加某个学生
    public Integer isAbleToTeacher(@Param("studentId") Integer studentId, @Param("teacherId") Integer teacherId);

    // 从班级移除学生
    public boolean removeClass(Integer studentId);

    // 获得被删除的学生
    public List<Student> getStudentsBeDeleted();
    // 清理被删除的学生
    public boolean clearAllDelete();


}
